package com.schematic.flixel.examples
{
import org.flixel.FlxState;
import org.flixel.FlxSprite;
import org.flixel.FlxG;

/**
 * Simple animation sample: an empty FlxState with an animated loop
 */
public class AnimationState extends ExampleState
{

    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Creates a new AnimationState instance.
     */
    public function AnimationState()
    {
        super();
    }

    //--------------------------------------------------------------------------
    //
    //  Overridden Methods - FlxState
    //
    //--------------------------------------------------------------------------    
    
    override public function create():void
    {
        super.create();
        
        var animation:AnimatedSprite = new AnimatedSprite();
        animation.x = 16;
        animation.y = 64;
        animation.playFullLoop();
        add(animation);
        
        animation = new AnimatedSprite();
        animation.x = 48;
        animation.y = 64;
        animation.playForwardLoop();
        add(animation);
        
        animation = new AnimatedSprite();
        animation.x = 80;
        animation.y = 64;
        animation.playBackwardLoop();
        add(animation);
        
        animation = new AnimatedSprite();
        animation.x = 112;
        animation.y = 64;
        animation.playRandomLoop();
        add(animation);
        
    }
}
}